﻿@{
    ViewBag.Title = "Online";
}

@{
    var Users = (Dictionary<String, MvcApplication1.Domain.User>)ViewBag.Users;
}


<html>
<body>

    <script src="~/Scripts/jquery-2.1.0.js"></script>
    <script src="~/Scripts/XSockets.latest.js"></script>
    <script src="~/Scripts/XSockets.WebRTC.latest.js"></script>



    <script>
        $(function () {

            var conn;
            var rtc;
            var parameter;
            var currentContext;
            var localVideo = document.getElementById("localVideo");
            var remoteVideo = document.getElementById("remoteVideo");
            var startClick = false;
            var onlyOnce = true;
            var conf = false;


            if (window.conn == null) {
                alert("null");
            } else {
                alert("not null");
            }

            //  conn = new XSockets.WebSocket('ws://212.146.135.107:4502/Kaabin');
            /*conn = new XSockets.WebSocket('ws://localhost:4502/Kaabin');




            conn.on("kimlerOnline", function (data) {
                alert('subscription to foo fired with data = ', data.text);
            });

            conn.on(XSockets.Events.open, function (clientInfo) {
                conn.publish('kimlerOnline', { text: 'Hello Real-Time World' });
            });*/





        });
    </script>


    <table id="domainlist" border="0" cellspacing="0" cellpadding="0">
        <thead>
            <tr>
                <th>
                    Username
                </th>
                <th>
                    OnlineStatus
                </th>

            </tr>
        </thead>
        <tbody>
            @{ foreach (var item in Users)
             {

                <tr>
                    <td>
                        @item.Value.name
                    </td>
                    <td id=" @item.Value.name ">
                        @item.Value.loginStatus
                    </td>
                </tr>
             }
            }
        </tbody>
    </table>
    <div id="logs"></div>
</body>
</html>
